package com.wwj.study.rmi.rpc.client;

public class ClientDemo {
    public static void main(String[] args) {

        thread();

    }

    private static void rpc(String name){
        RpcClientProxy rpcClientProxy=new RpcClientProxy();
        IHelloWorld helloWorld=rpcClientProxy.clientProxy(IHelloWorld.class,"127.0.0.1",9999);
        String str= helloWorld.sayHello("wwj"+name);
        System.out.println(str);
    }

    public static void thread(){
        for (int i=0;i<10;i++){
            Thread thread =new Thread(new Runnable() {
                public void run() {
                    rpc(Thread.currentThread().getName());
                }
            });
            thread.start();
        }
    }
}
